import { Component, OnInit, Inject, ChangeDetectionStrategy } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
// MAT_DIALOG_DATA用来接收穿过来的数据
// MatDialogRef是一个泛型的 用来将dialog中的数据往回传
@Component({
  selector: 'task-copy-task',
  templateUrl: './copy-task.component.html',
  styleUrls: ['./copy-task.component.scss'],
  // 对于笨组件 所有的状态改变都是来自于输入属性 值变他才会变
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CopyTaskComponent implements OnInit {
  lists: any;
  constructor(@Inject(MAT_DIALOG_DATA) private data, private dialogRef: MatDialogRef<CopyTaskComponent>) { }

  ngOnInit() {
    this.lists = this.data.lists;
  }
  onClick() {
    this.dialogRef.close(this.lists);
  }
}
